import { Injectable } from '@angular/core';
import {BadgePipe, SimpleJsonFormatter} from '../../../ng-tools';
import {SexComponent} from '../../../ng-tools/src/components/badge/sex/sex.component';
import {OnlineComponent} from '../../../ng-tools/src/components/badge/online/online.component';

@Injectable({
  providedIn: 'root'
})
export class CustomerFormatterService {
    userId: SimpleJsonFormatter = {propName: 'userId', displayName: '客服ID'};
    userMail: SimpleJsonFormatter = {propName: 'userMail', displayName: '客服邮箱'};
    nickName: SimpleJsonFormatter = {propName: 'nickName', displayName: '客服昵称'};
    userSex: SimpleJsonFormatter = {propName: 'userSex', displayName: '客服性别', component: SexComponent};
    userStatus: SimpleJsonFormatter = {propName: 'userStatus', displayName: '客服状态', component: SexComponent};
    online: SimpleJsonFormatter = {propName: 'online', displayName: '在线状态', component: OnlineComponent};
    roles: SimpleJsonFormatter = {propName: 'roles', displayName: '角色'};
    constructor(private badgePipe: BadgePipe ) {
        this.online.pipe = {pipeTransform: this.badgePipe, args: [['在线', '离线'], ['badge-success', 'badge-danger']]};
        this.userSex.pipe = {pipeTransform: this.badgePipe, args: [['女', '男'], ['badge-success', 'badge-danger']]};
    }
    get formatter() {
        return [
            this.userId,
            this.userMail,
            this.nickName,
            // this.userSex,
            // this.userStatus,
            // this.online
        ];
    }
}
